home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
64-bit_x64
/
Russian
/
cpsimage.cab
/
data
/
xps
/
pdf2xps.elf
< prev
next >
Wrap
Text File
|
2009-04-23
|
1KB
|
51 lines
/*
** A script to read PDF and emit XPS
**
** M.Campanelli 11/1/05
** Updated 7/12/06
** Converted to use DOCUMENTWRITER 7/18/06 - Kingsley
*/
#import "documentio.ucm";
#load "sys/stdlib.elf";
LoadClasses (filename: "xeng");
// Give me a PDF file to convert
IMPORT STRING infile;
// Error checking
if ( !infile )
{ print "Need infile argument, i.e., infile:s filename "; end; }
if ( !new(FILE, path : infile ).isFile() )
{ print "invalid infile: " + infile; end; }
// Make a directory of the filename to collect XPS files in
STRING dir = infile.name() + ".xps";
// Get a document reader
DOCUMENTREADER dr = CreateDocumentReader (filename: infile);
// Verbose output
INTEGER pgCnt = dr.getPageCount ();
print infile + " has " + pgCnt + " pages";
DOCUMENTWRITER dw = CreateDocumentWriter( filename: dir, format:"xps");
// Variables
INTEGER pgNum = 1;
XIPIMAGE img;
for ( pgNum=1; pgNum<=pgCnt; pgNum++ )
{
print "working on pg " + pgNum;
img = dr.getPage (pgnum:pgNum);
dw.appendPage(pgImg:img);
}
// Release resources
dr.release();
dw.release();
// How long has this taken
print TimeCheck();